<?php
/**
 * Created by PhpStorm.
 * User: qttx
 * Date: 2019/5/30
 * Time: 13:58
 */
namespace app\api\model;
use think\Db;

class RealModel extends BaseModel
{
    protected $table = "xst_user";
    protected $rule = [
        'id' => '',
    ];
    protected $msg = [
        'id' => '',
    ];

    /**实名认证申请**/
    public function realname_update($add,$id)
    {
        Db::startTrans();
        $realname_update = $this->where('id',$id)->update($add);
        $query = changeBalance($id,0,abs($add['cost']),7,"实名收取费扣除");
        if($realname_update && $query)
        {
            Db::commit();
            return true;
        }else{
            Db::rollback();
            return false;
        }
    }
}